package com.ruoyi.project.config.config;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.info.domain.AppInfo;
import com.ruoyi.project.info.service.IAppInfoService;
import com.ruoyi.project.slideshow.domain.AppSlideshow;
import com.ruoyi.project.slideshow.service.IAppSlideshowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/config/api")
public class ConfigApiController  extends BaseController {
    @Autowired
    private IAppSlideshowService appSlideshowService;

    @Autowired
    private IAppInfoService appInfoService;

    //获取轮播图
    @GetMapping("/getIndex")
    public TableDataInfo getIndex()
    {
        AppSlideshow appSlideshow = new AppSlideshow();
        List<AppSlideshow> appSlideshows = appSlideshowService.selectAppSlideshowList(appSlideshow);
        return getDataTable(appSlideshows);
    }

    //获取用户协议
    @GetMapping("/getInfo")
    public TableDataInfo getInfo()
    {
        AppInfo appSlideshow = new AppInfo();
        List<AppInfo> appInfos = appInfoService.selectAppInfoList(appSlideshow);
        return getDataTable(appInfos);
    }
}
